// cheng/pages/money/money.js
var app = getApp();
Page({
  data: {
    appUserInfo:{},
    money:0,
    result:99,
    hosId:app.api.siteinfo.hosId2,
  },
  onLoad: function (o) {
    console.log(o)
    var appUserInfo=wx.getStorageSync('appUserInfo');
    if(appUserInfo && appUserInfo.customerId){
      this.setData({appUserInfo, parmas:o})
      //this.getRed(o,appUserInfo)
    }
  },
  getRed(o,info){
    var t = this;
    wx.showLoading()
    wx.request({
      url: t.data._api_live + "hbActionGZH/getHB",
      data:{
        storeId:app.api.siteinfo.acid,
        access_token:wx.getStorageSync('ACCESS_TOKEN'),
        liveId:o.liveId,
        mobile:info.mobile,
        hbcount:o.count,
        hb_batch_id:o.id
      },
      success(e){
        e = e.data;;
        console.log(e)
        wx.hideLoading()
        t.setData({money:e.money, result:e.result})
        wx.showToast({icon:'none',title:e.message})

      }
    })
  },
  go(){
    wx.navigateBack({delta: 1})
  }
})